import 'package:flutter/material.dart';
import 'package:flutter_app/widgets/button_column.dart';

class HomeClassify extends StatefulWidget {
  const HomeClassify({Key? key}) : super(key: key);

  @override
  State<HomeClassify> createState() => _HomeClassifyState();
}

class _HomeClassifyState extends State<HomeClassify> {
  @override
  Widget build(BuildContext context) {
    Color color = Theme.of(context).primaryColor;
    List _buildButtonColumnList = [
      {
        "pushUrl": '/login',
        "icon": const IconData(0xe60d, fontFamily: 'MyIconsTwo'),
        "name": '整租',
        "color": color
      },
      {
        "pushUrl": '/login',
        "icon": const IconData(0xe638, fontFamily: 'MyIconsTwo'),
        "name": '合租',
        "color": color
      },
      {
        "pushUrl": '/login',
        "icon": const IconData(0xe603, fontFamily: 'MyIconsTwo'),
        "name": '地图找房',
        "color": color
      },
      {
        "pushUrl": '/login',
        "icon": const IconData(0xe620, fontFamily: 'MyIconsTwo'),
        "name": '去出租',
        "color": color
      },
    ];
    return Row(
      mainAxisAlignment: MainAxisAlignment.spaceEvenly,
      children: _buildButtonColumnList
          .map((e) => (BuildButtonColumn(
                icon: e["icon"],
                label: e["name"],
                color: e["color"],
                pushUrl: e["pushUrl"],
              )))
          .toList(),
    );
  }
}
